Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuations #145

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Continuations #145

wants to merge 1 commit into from

Conversation

beevik
Copy link
Owner

@beevik beevik commented Jan 17, 2025

No description provided.

@3052 3052 mentioned this pull request Jan 18, 2025
@beevik
Copy link
Owner Author

beevik commented Jan 21, 2025

Renamed Element.Create to Element.CreateElementContinue. This naming, while more verbose, is more consistent with the naming conventions used by other "overloaded" functions in the etree package. The Create name was ambiguous, especially considering that there are many other types of tokens that are created using the same verb (CreateAttr, CreateProcInst, etc.).

@3052
Copy link

3052 commented Jan 21, 2025

yeah I waffled on that too - however I would strongly reconsider, as repeating CreateElementContinue 100 times is going to be really painful/ugly for anyone building a tree of any decent size

@beevik
Copy link
Owner Author

beevik commented Jan 21, 2025

I'm sympathetic to the verbosity concern, but I'm less flexible on the ambiguity aspect. If we're to use the Create terminology, then it can't be ambiguous about what's being created, especially since none of the existing functions are ambiguous.

Let's try AddElement. There's already an existing function AddToken, so it's not without precedent. Not as short as Create, but not much longer either.

I wish go had function overloading.

@3052
Copy link

3052 commented Jan 21, 2025

another option is "Continue" - but AddElement is short enough that I wont fight you on it

Introduced the Element.AddElement function to support the
creation of child elements with continuation functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants